package javaBase.javaIO;

import java.io.File;
import java.io.IOException;

/**
 * Created by Administrator on 2017/5/15 0015.
 */
public class FileExample {
    public static void createFile() {
        File f = new File("D:/logs/create.txt");
        try {
            f.createNewFile();
            System.out.println("该分区大小" + f.getTotalSpace() / (1024 * 1024 * 1024) + "G");
            f.mkdir();
            System.out.println("文件名  "+f.getName());
            System.out.println("文件父目录字符串 "+f.getParent());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        createFile();
    }
}
